package org.lt.resume.controller.resume;

import java.util.List;

import org.apache.struts2.json.annotations.JSON;
import org.lt.resume.service.resumeserviceInterface.ResumeServiceInterface;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class SearchResumeForTableController extends ActionSupport{


	/****/
	private static final long serialVersionUID = -871399603386245862L;

	private String username;

	private List items;

	private ResumeServiceInterface resumeService;
	
	@Override
	public String execute() throws Exception {

		if(username.trim().equals("")) {
			items = resumeService.searchResume(0);
		} else {
		   items = resumeService.searchResumeForTable(username);
		}
		return Action.SUCCESS;

	}

	@JSON(name="items")
	public List getItems() {
		return items;
	}

	public void setItems(List items) {
		this.items = items;
	}
	
	public void setUsername(String username) {
		this.username = username;
	}

	public void setResumeService(ResumeServiceInterface resumeService) {
		this.resumeService = resumeService;
	}
	
	
}
